{// 引入标签库 }

<tagLib name="fanwe" />

{// 加载头部公共文件 }

<include file="Public:header" />

<!-- 菜单区域  -->



<!-- 主页面开始 -->

<div id="main" class="main" >



<!-- 主体内容  -->

<div class="content" >

<div class="title">{$Think.lang.DATA_LIST}</div>

<!--  功能操作区域  -->

<div class="operate" >

<fanwe:imageBtn  value="{$Think.lang.BACKUP_DATABASE}" style="impBtn hMargin fLeft shadow" />

<!-- 查询区域 -->

<div class="fRig">
<form method='post' action="">

</div>



</div>

<!-- 高级查询区域 -->

<div  id="searchM" class=" none search cBoth" >

</div>

</form>

</div>

<div >
<form  method='post' id="form" name="form" action="{:u('Database/dump')}">
<!-- 功能操作区域结束 -->
<table>
	<tr>
    	<td><input type="checkbox" name="checkbox"  onclick=" list_show(this.checked) "  />自定义备份<span style="color:red;">(若不选则为全部备份)</span></td>
    </tr>
    <tr>
    	<td></td>
    </tr>
</table>
<div id="data_list" style="display:none;">
<tbody id="showtables">
  <tr>
    <td colspan="2">
      <table>
        <tr>
          <td colspan="4"><input name="chkall" onclick="checkall(this.form, 'customtables[]')" type="checkbox"><b>全选</b></td>
        </tr>
        <tr>
        <volist  id="table" name="tables"  key="k">
          <if condition="(($k-1)%7) eq 0">
          </tr><tr>
          </if>
          <td><input name="customtables[]" value="{$table}"  type="checkbox">{$table}</td>
        </volist >
        </tr>
        
      </table>
    </td>
  </tr>
  </tbody>
</div>
<table>
<tr>
    <td>备份文件名:</td>
    <td><input type="text" name="sql_file_name" value="{$name}">&nbsp; <input type="submit" value="开始备份" class="button" /></td>
  </tr>
     
</table>
</form>
</div>
<!-- 列表显示区域  -->

<div class="list" >

<table cellspacing="0" cellpadding="0" class="list" id="checkList">
	<tr><td height="5" class="topTd" colspan="5"/></tr>
	<tr class="row">
		<th width="8"></th>
		<th>{$Think.lang.BACKUP_FILE}</th>
		<th>{$Think.lang.CREATE_TIME}</th>
		<th>{$Think.lang.OPERATION}</th>
	</tr>
	<foreach name="sql_list" item="sql_item">
		<tr class="row">
			<td width="8"></td>
			<td>{$sql_item.filename}</td>
			<td>{$sql_item.filedate}</td>
			<td><a href="{:U('Database/restore',array('dir'=>$sql_item['filename']))}">{$Think.lang.RESTORE}</a> <a href="{:U('Database/delete',array('dir'=>$sql_item['filename']))}">{$Think.lang._DELETE_DATA}</a></td>
		</tr>
	</foreach>
	<tr><td height="5" class="bottomTd" colspan="5"/></tr>
</table>

</div>

<!--  分页显示区域 -->

<!-- 列表显示区域结束 -->

</div>

<!-- 主体内容结束 -->

</div>

<!-- 主页面结束 -->
<script>
function checkall(frm, chk)
{
    for (i = 0; i < frm.elements.length; i++)
    {
        if (frm.elements[i].name == chk)
        {
            frm.elements[i].checked = frm.elements['chkall'].checked;
        }
    }
}
function list_show($is)
{
	if($is==1){ document.getElementById('data_list').style.display="block";}
	else{
		document.getElementById('data_list').style.display="none";
		}
}
</script>



